#include<stdio.h>
int main()
{
	int i = 0;
	int num = 0;
	int word = 0;
	char arr[100];
	gets(arr);
	while (arr[i])
	{
		if (arr[i] == ' ')
		{
			word = 0;
		}
		else
		{
			if (word == 0)
			{
				word = 1;
				num++;
			}
		}
		i++;
	}
	printf("%d", num);
	return 0;
}

